﻿using System;
using System.Collections.Generic;
using System.Text;

namespace program05
{
    //成绩管理类
   public class GradeManage
    {
        public Student Stu { get; }

        public Course1 c1 { get; }

        public Course2 c2 { get; }

        public int Sum { get; }
        public GradeManage() { }

        public GradeManage(string stuNo,string stuName,int age)
        {
            Stu = new Student()
            {
                No = stuNo,
                Name = stuName,
                Age = age
            };
           
        }
        public GradeManage(string stuNo, string stuName, int age,
            string cName1, int cPeriod1, int cCredit1, int cScore1,
            string cName2, int cPeriod2, int cCredit2, int cScore2)
        {
            Stu = new Student()
            {
                No = stuNo,
                Name = stuName,
                Age = age
            };

            c1 = new Course1()
            {
                Name = cName1,
                Period = cPeriod1,
                Creidt = cCredit1,
                Score = cScore1
            };

            c2 = new Course2()
            {
                Name = cName2,
                Period = cPeriod2,
                Creidt = cCredit2,
                Score = cScore2
            };

            Sum = c1.Score + c2.Score;
        }

        //打印方法
        public void Print() => Console.WriteLine($"{Stu}{c1}{c2} 总分：{Sum}");
    }
}
